<?php
include "../mysql/mysql.php";
    $aa = new mysql;
    $aa->link("");
    include "../myfunction.php";
    $bb= new myfunction;



$q=@$_GET["q"]; 
$qq= explode("-", $q); 
$newmname= $qq[0];
$newmpw1= $qq[1];
$newmpw2= $qq[2];
$newmright= (int)$qq[3];
$adminname = $qq[4];

//var_dump($pw);
//var_dump($name);
$res = $bb->findmanageuser($adminname);
$rightconl = $res['right_control'];

if($rightconl == 1){
	$newmpw1 = $bb->jiami($newmpw1);
$sql = "INSERT INTO manage_info (user_name, user_pw, right_control)
                      VALUES ('$newmname', '$newmpw1', '$newmright')";
$result= $aa->excu($sql);

//var_dump($result);
if($result == 'TURE'){
	echo '新管理员已添加';
	}else{
		echo "添加管理员失败,请重试！";
		}
}
else{
	echo "您没有权限";
	}

include "../mysql/mysqlclose.php";
?>